<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<script>
// url => 资源 接口 json
// http://api.github.com/users/wesbos
(async function(){
    // await 后 promise 执行的，resolve把结果给左边
    // const response = await fetch('http://api.github.com/users/wesbos');
    // const data = await response.json();
    // console.log(data)
    const p1 = fetch("http://api.github.com/users/wesbos")
    const p2 = fetch("http://api.github.com/users/shunwuyu")
    const res = await Promise.all([p1,p2]) // static  并发执行
    // console.log(res)
    const dataPromises = res.map(r =>r.json())
    const [wes,shunwu] = await Promise.all(dataPromises)
    console.log(wes,shunwu);
})()

    // .then(data => data.json())
    // .then(data =>{
        // console.log(data);
    // })
</script>
</body>
</html>